

import alias from 'rollup-plugin-alias'
import commonjs from "rollup-plugin-commonjs";    //将CommonJS模块转换成ES6，防止他们在Rollup中失效;

const { join } = require('path')
const resolve = require('rollup-plugin-node-resolve')
const rollup=require('rollup')

const babel = require('rollup-plugin-babel')
const cwd = __dirname


export default {
  input:'./app/jreact/index.js',
  output:{
    format:'iife',
    file:'dist/jreact.js',
  },
  plugins:[
    commonjs(),           //将CommonJS模块转换成ES6;
    alias({
      'jim':join(cwd,'app/jim'),
      'src':join(cwd,'app/src'),
      'utils':join(cwd,'app/utils'),
      'jreact':join(cwd,'app/jreact'),
    }),
    resolve({
      preferBuiltins: false,
    }),  
  babel({
    babelrc:false,
    presets: ['es2015-rollup', 'stage-0'], //转ES5的插件;
    plugins: ['transform-class-properties'],//转换静态类属性以及属性声明的属性初始化语法
    exclude: 'node_modules/**'
  })],

}


